home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Net / Utilities / Seer family 2.0 / sr_prg.src / sp_init_mac.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-11-17  |  1.2 KB  |  44 lines  |  [TEXT/KAHL]

  1. /*sp_init_mac.p - initilize the mac operating system*/
  2. /*initilize the mac operating system, set up the menu bar*/
  3.  
  4. #include "sp.h"
  5. #include "sc_event.h"
  6. #include "sp_menu.h"
  7.  
  8. void init_mac()
  9. {InitGraf(&thePort);
  10.  InitFonts();
  11.  FlushEvents(everyEvent,0);
  12.  InitWindows();
  13.  InitMenus();
  14.  TEInit();
  15.  InitDialogs(NIL);
  16.  InitCursor();
  17.  MaxApplZone();
  18.  {int i;
  19.   for(i=0;i<NUM_MASTS;i++)
  20.    MoreMasters();
  21.  } /*end declare i*/
  22.  SetRect(&dragRect,
  23.      4,24,screenBits.bounds.right-4,screenBits.bounds.bottom-4);
  24.  
  25.  {int scan_menu;            /*step thru menus to initilize*/
  26.   MenuHandle    amenu;        /*each menu as its resource is read*/
  27.   int resid;                /*each resource id*/
  28.   /*get each menu from the resource file*/
  29.   for(scan_menu=MENU_first;scan_menu<=MENU_max;scan_menu++) {
  30.    resid=scan_menu+gl.res_base;     /*compute resource id to read*/
  31.    amenu=GetMenu(resid);            /*read the next menu*/
  32.    menu_handles[scan_menu]=amenu;    /*remember it*/
  33.    if(amenu==NIL)                    /*report failure*/
  34.      bomb(BOMB_nomenu,BMB_no_os,resid);
  35.    InsertMenu(menu_handles[scan_menu],0);
  36.    } /*for*/
  37.  } /*variable for reading menus*/
  38.  
  39.  /*add the desk accessories*/
  40.  AddResMenu(menu_handles[MENU_apple], 'DRVR');
  41.  
  42.  DrawMenuBar();                    /*the menu bar is set up, paint it*/
  43. }
  44.